package org.dey.controller;

import org.dey.pojo.Menu;
import org.dey.pojo.User;
import org.dey.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author deyran
 * @date 2022/3/23 16:00
 * @classname
 * @see
 */
@RestController
public class MenuController {

    @Autowired
    MenuService menuService;

    @PostMapping("menu")
    public List<Menu> menus(@RequestBody User user){
        return menuService.MENU_ROLE_LIST(user.getUsername());
    }
}
